[gd_scene load_steps=8 format=3 uid="uid://bb2d2pg141px2"]

[ext_resource type="Material" uid="uid://wmxpt4du7a7o" path="res://materials/textured_block_material.tres" id="1_aaj47"]
[ext_resource type="Script" path="res://player_controller.gd" id="1_sc6rc"]
[ext_resource type="Material" uid="uid://ccvmfntb7w7un" path="res://materials/selection_material.tres" id="4_y6f8l"]
[ext_resource type="Texture2D" uid="uid://o1xfqjo1nbsw" path="res://textures/crosshair.png" id="5_r8a1l"]
[ext_resource type="Environment" uid="uid://bh13kcd0h21o6" path="res://env/world_env.tres" id="6_2njup"]

[sub_resource type="CapsuleMesh" id="CapsuleMesh_hk3se"]
radius = 0.3
height = 1.7

[sub_resource type="BoxMesh" id="BoxMesh_yunsl"]
material = ExtResource("4_y6f8l")
size = Vector3(1.05, 1.05, 1.05)

[node name="Root" type="Node"]

[node name="CraftdigBridge" type="CraftdigBridge" parent="." node_paths=PackedStringArray("player", "camera", "selection", "lbl_coords", "lbl_blkty")]
chunk_update_rate = 128
init_world_script = "
p 0 0 0

filllayer s
up
filllayer s
up
filllayer d
up
filllayer g
up

# do a weird shape like this:
#  @
# @@@@
p 5 4 5
setmx c
setmx c
setmx c
setmx c
p 6 5 5
set g

# and then another block next to it
p 6 4 7
set c

write
"
player = NodePath("../CharacterBody3D")
camera = NodePath("../CharacterBody3D/Camera3D")
selection = NodePath("../Selection")
block_mat = ExtResource("1_aaj47")
lbl_coords = NodePath("../Coords")
lbl_blkty = NodePath("../SelBlock")

[node name="ChunksRoot" type="Node3D" parent="CraftdigBridge"]

[node name="CharacterBody3D" type="CharacterBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 20, 5, 1)
script = ExtResource("1_sc6rc")
jump_vel = 35.0

[node name="Camera3D" type="Camera3D" parent="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
fov = 85.0

[node name="MeshInstance3D" type="MeshInstance3D" parent="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
mesh = SubResource("CapsuleMesh_hk3se")
skeleton = NodePath("")

[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.516967, -0.525973, 0.67535, 0, 0.788955, 0.614451, -0.856005, -0.31765, 0.407864, 8.55806, 7.36706, 4.01961)

[node name="Selection" type="Node3D" parent="."]

[node name="SelectionBox" type="MeshInstance3D" parent="Selection"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.5, 0.5)
mesh = SubResource("BoxMesh_yunsl")
skeleton = NodePath("")
metadata/_edit_lock_ = true

[node name="SelBlock" type="Label" parent="."]
offset_left = 12.0
offset_top = 56.0
offset_right = 136.0
offset_bottom = 88.0
text = "cobblestone"

[node name="Coords" type="Label" parent="."]
offset_left = 12.0
offset_top = 12.0
offset_right = 184.0
offset_bottom = 44.0
text = "X 123 / Y 3 / Z 789"

[node name="TextureRect" type="TextureRect" parent="."]
texture_filter = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -64.0
offset_top = -64.0
offset_right = 64.0
offset_bottom = 64.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("5_r8a1l")

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource("6_2njup")
